#ifndef _BSP_TIMER_H
#define _BSP_TIMER_H


#include "driver/gptimer.h"

#define TIMER2_BASE_TICK  20                     // 定时器周期20us

/* 磁疗BASE */
#define MAGANETIC_PERIOD    20000                       // about 50Hz
#define MAGNANETIC_OUTPUT_DURATION  2000                // 2ms
#define VIB_0HZ_PERIOD      0
#define VIB_2HZ_PERIOD      (MAGANETIC_PERIOD * 25)          // about 2Hz
#define VIB_5HZ_PERIOD      (MAGANETIC_PERIOD * 10)          // about 5Hz
#define VIB_10HZ_PERIOD     (MAGANETIC_PERIOD * 5)          // about 10Hz

/* 磁疗USE */
#define VIB_0HZ_TICKS               0
#define VIB_2HZ_TICKS               (VIB_2HZ_PERIOD/TIMER2_BASE_TICK)
#define VIB_5HZ_TICKS               (VIB_5HZ_PERIOD/TIMER2_BASE_TICK)
#define VIB_10HZ_TICKS              (VIB_10HZ_PERIOD/TIMER2_BASE_TICK)
#define MAGANETIC_TICKS_PERIOD      (MAGANETIC_PERIOD / TIMER2_BASE_TICK)
#define MAGNANETIC_OUTPUT_TICKS     (MAGNANETIC_OUTPUT_DURATION / TIMER2_BASE_TICK)
#define VIB_OUTPUT_TICKS            (MAGNANETIC_OUTPUT_TICKS)


/* 电疗BASE */



/* 电疗USE */




void gptimer1_close(void);
void gptimer1_open(void);
void gptimer2_close(void);
void gptimer2_open(void);

void mygptimer_init(gptimer_alarm_cb_t callback_func);
void mygptimer2_init(gptimer_alarm_cb_t callback_func);
#endif
